#include "AlarmAcceptor.h"

AlarmAcceptor::AlarmAcceptor(InetAddress &addr, Reactor * reactor)
  : acceptor_(addr), reactor_(reactor) 
{
  reactor->registerHandler(this, ACCEPT_EVENT);
  entries_ = new std::list<AlarmEntry>();
}

void AlarmAcceptor::handleEvent (Handle h, EventType et)
{
  if (et == ACCEPT_EVENT)
    {
      SocketStream * clientConnection = new SocketStream();
      acceptor_.accept(*clientConnection);
      AlarmHandler * ah = new AlarmHandler(clientConnection, reactor_, entries_);
    }
}

Handle AlarmAcceptor::getHandle() const
{
  return acceptor_.getHandle();
}



